package edu.java.homework.hw06.products;

public enum MilkProduct {
    YELLOW_CHEESE(90), WHITE_CHEESE(90);

    // --- Instance Variables
    // ---------------------------------------------------
    private int price = 0;

    // --- Constructors
    // ---------------------------------------------------------
    private MilkProduct() {
	this(0);
    }

    private MilkProduct(int price) {
	this.price = price;

	// WRONG PRACTICE --> NOT RECOMMEND to call other methods in the
	// constructors
	// setPrice(price);
    }

    // --- Methods
    // --------------------------------------------------------------
    public int getPrice() {
	return price;
    }

    // Usually this is not good to be done, because the enum is supposed to keep
    // information, which is not going to be changed in the time
    /*public void setPrice(int price) {
	// check input parameters
	if (price < 0) {
	    throw new IllegalArgumentException(
		    "Incorrect input. The price would be 0 or positive integer number");
	}
	this.price = price;
    }*/

    @Override
    public String toString() {
	return this.name().toLowerCase();
    }

}
